import type { UserInfo } from '@vben/types';

import { useRequest } from '#/api/core/api';
import { requestClient } from '#/api/request';

export const { useRequestHandle, requestPath } = useRequest('/user');

/**
 * 获取用户信息
 */
export async function page(params: Record<string, any>) {
  return requestClient.get<UserInfo>('/user/page', {
    params,
  });
}

export async function removeBatchByIds(ids) {
  return requestClient.delete<UserInfo>('/page', ids);
}
export async function add(data) {
  return requestClient.post<UserInfo>('/page', data);
}
export async function edit(data) {
  return requestClient.put<UserInfo>('/page', data);
}
